This patent application claims for benefit of the filing date of Japanese Patent Application No. P11-264560 filed on Sep. 17, 1999, the entire contents of which are hereby incorporated by reference.
1. Field of the Invention
The present invention relates to a transmitting apparatus having an error handling function in data transmission between a network and devices, and to an error handling method. More particularly, the invention relates to a link layer data transmitting apparatus adhering to xe2x80x9cIEEE Standard for a High Performance Serial Bus (IEEE 1394-1995 Std., hereinafter)xe2x80x9d.
2. Description of the Related Art
In order to realize an inexpensive and high performance digital network by connecting peripheral devices of a computer apparatus and a consumer apparatus, or peripheral apparatuses with each other, IEEE 1394-1995 Std. is standardized by IEEE (Institute of Electrical and Electronics Engineers).
A protocol defined by the IEEE 1394.a has a layered structure as shown in FIG. 1. In this protocol, a method for exchanging functions of layers such as PHY (Physical Layer) 102 and Link (Link Layer) 101, data and control information between the layers is defined as standard. As transmission mode, there exist an Isochronous transmission 103 for transmitting data at given intervals, and an Asynchronous transmission 104 for transmitting data at arbitrary time. A format of a packet (transmitted data) transmitted between nodes in each transmission mode is also defined.
An example of format of the packet of the Asynchronous transmission 104 is shown in FIG. 2.
The packet 110 comprises a fixed-length header portion 114 having a destination ID 111, a source ID 112 and a data length 113; and a variable-length data section 116 having a data field 115. The actual length of the data field 115 can be recognized by referring to the data length 113 of the fixed-length header portion 114.
In order to detect an error, a header CRC (Cyclic Redundancy Check) 117 is added to the end of the header portion, and a data CRC 118 is added to the end of a data portion.
Next, an example of a link layer transmitting apparatus adhering to the IEEE 1394-1995 Std., p1394.a is shown in FIG. 3, and an example of operation thereof is shown in FIG. 5. A state of stored data in a data storingiregion 14a is shown in FIG. 4.
The transmitting apparatus 10a comprises a lower interface 11, a CRC judging section 12, a reception-controlling section 13a, and the data storing region 14a and a higher interface 15a. 
When the lower interface 11 receives data through a data signal 16 (step S30), the lower interface 11 transmits a packet received through a data signal 17 and a data signal 18 to the CRC judging section 12 and the reception-controlling section 13a. 
The reception-controlling section 13a refers to the header portion 114 of the received packet 110 (step S31), and judges whether the received data is directed to the own node (step S32). If the data is directed to the own node, a reception packet is formed and stored in the data storing region 14a (FIFO/RAM) through a data signal 19a, and waits a result of CRC error judgment from the CRC judging section 12.
The CRC judging section 12 judges whether there is a CRC error in the received packet 110, and transmits the judgment result to the reception-controlling section 13a through a control signal 22.
The reception-controlling section 13a generates an acknowledge signal to be returned to the source node based on the CRC judgment result, transmits the acknowledge signal 26 to the lower interface 11, and stores the same in acknowledge information 120 (AckSent) of the data storing region 14a. Further, the reception-controlling section 13a informs the higher interface 15a that the reception was completed, and the higher interface 15a informs higher application 45 (step S33, step S35).
The header portion 114 and the data portion 116 of the received packet 110 are sequentially stored in the data storing region 14a. A speed information 119 (Spd) of the corresponding packet 110 and an acknowledge signal sent back to the source with respect to the corresponding received packet are added to the end of the data portion as the acknowledge information 120 (AckSent). The header CRC 117 and a data CRC 118 of the received packet 110 are eliminated. A plurality of received packets 110 can be stored in the data storing region 14a. 
The acknowledge signal 26 to be sent back to the source and the acknowledge information 120 to be stored in the data region are defined as follows: xe2x80x9ccompletexe2x80x9d: reception completion (no responding packet exists), xe2x80x9cpendingxe2x80x9d: reception completion (responding packet exists), xe2x80x9cbusyxe2x80x9d: own node is busy and packet could not be received, xe2x80x9cdata errorxe2x80x9d: there was error in the received packet.
When the higher application 40 is informed by the transmitting apparatus 10a that a packet has been received, the higher application 40 reads out data from the data storing region 14a through the higher interface 15a (step S36). At that time, the acknowledge information 120 can be referred based on the data length 113 stored in the data storing region 14a, and it is possible to judge whether there is an error in the received packet (steps S36 to S36b).
However, the above-described transmitting apparatus has the following problems.
Firstly, since the acknowledge information is located behind the data portion, even if the CRC error is detected in the received packet in the transmitting apparatus, the higher application can not recognize that the CRC error is occurred until all the data in the packet is read in. Therefore, it is necessary to read in all the data including unnecessary error data, and especially when a packet having large data length is processed, the processing time of the higher application is largely increased.
Secondly, even when a normal packet having no error was received and the higher application was informed that the reception of the packet had been completed, the higher application can not utilize the packet. until the application read all the data in the packet and confirms the acknowledge information. For example, when the application desires to utilize only the top of the data portion, the higher application must read in all the data including the unnecessary portion.
Thirdly, when an error is occurred in the reception packet and data length in the header portion of the packet and the actual data length are different, it is impossible to recognize where of the data storing region the acknowledge information is stored. Therefore, there is an adverse possibility that the higher application can not precisely judges whether there is an error in the received packet of the application erroneously judges.
Fourthly, like the third problem, when data length in the header portion of the packet and the actual data length are different, if the next packet is received and stored in the data storing region in the state in which the packet having the error remains in the state storing region, a data storing-starting position of this packet data can not be recognized.
The present invention has been accomplished to solve the above-described conventional problems, and it is an object of the invention is to provide a transmission apparatus having an error handling function and an error handling method capable of recognizing whether a data CRC error is occurred without reading out all the received data, and in which no malfunction occurs even when data length in the header portion of the packet and the actual data length are different.
To achieve the above object, a first aspect of the present invention is characterized in that when an error was detected in a received packet, a higher application is informed that the error was occurred, and when no error was detected in the received packet, a higher application is informed that a packet has been received.
According to the first aspect, when there is a data CRC error, the error occurrence information is transmitted, and when there is no error, the reception completion information is transmitted so that the processing can clearly be distinguished. Therefore, the higher application can recognize that the CRC error is occurred without reading all the data in the received packet by the error occurrence information or the reception completion information. Therefore, the processing time of the higher application 40 can be reduced. Further, since it is unnecessary to refer an acknowledge information in the data region, data can be processed even when data length in the header portion of the packet and the actual data length are different.
A second aspect of the present invention is characterized in that if a next packet is received while the packet having a detected error is stored in said data storing region, the packet stored in the data storing region is invalidated by a request from the higher application, thereby sending back, to the source node, an acknowledge signal indicating that the packet can not be received.
According to the second aspect, as long as an error packet remains in the data storing region, a next packet is not received. Therefore, even when data length in the header portion of the packet and the actual data length are different, a problem that a data storing-starting position of this packet data can not be recognized is overcome.
A third aspect of the invention is characterized in that when the error-detecting means detected an error, the corresponding packet stored in the data storing region is invalidated at that time. When the packet is invalidated, only the data portion may be invalidated.
According to the third aspect, only a normal packet, or the normal packet and an error packet having only the header portion are stored in the data storing region. Therefore, even when data length in the header portion of the packet and the actual data length are different, a problem that a data storing-starting position of this packet data cannot be recognized is overcome.
Other and further objects and features of this invention will be become obvious upon an understanding of the illustrative embodiments about to be described in connection with the accompanying drawings or will be indicated in the appended claims, and various advantages not referred to herein will occur to one skilled in the art upon employing of the invention in practice.